  <template>
      <div class="index-lists">
          <div style="display: flex; justify-content: space-between; width: 90%">
              <div class="cpctitle">CPC递交类型：</div>
              <el-form-item prop="caseType">
                  <el-select v-model="formData.caseType" clearable>
                      <el-option label="张三" value="1" />
                      <el-option label="李四" value="2" />
                      <el-option label="王五" value="3" />
                  </el-select>
              </el-form-item>
              <el-form-item prop="caseType">
                  <el-select v-model="formData.caseType" clearable>
                      <el-option label="张三" value="1" />
                      <el-option label="李四" value="2" />
                      <el-option label="王五" value="3" />
                  </el-select>
              </el-form-item>
              <el-form-item prop="caseType">
                  <el-select v-model="formData.caseType" clearable>
                      <el-option label="张三" value="1" />
                      <el-option label="李四" value="2" />
                      <el-option label="王五" value="3" />
                  </el-select>
              </el-form-item>
              <span style="color: #c9161b; padding-top: 7px">注：转请求书以前需要点击保存所有</span>
          </div>
          <el-collapse v-model="activeNamesshizhi" v-if="isoksy">
              <el-collapse-item title="实用新型请求书" name="1">
                  <br />
                  <b style="font-size: 15px">请求内容：</b>
                  <span>根据专利法第35条的规定，请求对上述专利申请进行实质审查。</span>
                  <el-form ref="formRef" label-width="194px" :rules="formRules" :inline="true">
                      <el-checkbox-group v-model="formData.caseType">
                          <el-checkbox
                              label="申请人申明，放弃专利法实施细则第57条规定的主动修改的权利。"
                              name="caseType"
                          ></el-checkbox>
                      </el-checkbox-group>
                  </el-form>
                  <br />
                  <b style="font-size: 15px">请求延迟审查：</b>
                  <el-form ref="formRef" :rules="formRules">
                      <el-form-item>
                          <el-radio-group label="" name="caseType">
                              <el-radio label="0"> 请求对本申请延迟审查,延迟期限为1年。 </el-radio>
                              <el-radio label="1"> 请求对本申请延迟审查,延迟期限为2年。 </el-radio>
                              <el-radio label="2"> 请求对本申请延迟审查,延迟期限为3年。 </el-radio>
                          </el-radio-group>
                      </el-form-item>
                  </el-form>
                  <br />
                  <b style="font-size: 15px">备注</b>
                  <el-form ref="formRef" label-width="194px" :rules="formRules" :inline="true">
                      <el-checkbox-group v-model="formData.caseType">
                          <el-checkbox label="其他情况" name="caseType"> </el-checkbox>
                      </el-checkbox-group>
                      <!-- <el-form-item> -->
                      <el-input />
                      <!-- </el-form-item> -->
                  </el-form>
                  <br />
                  <b style="font-size: 15px">附件清单</b>
                  <el-table class="mt-4" size="large" stripe>
                      <el-table-column label="序号" prop="test" min-width="180" />
                      <el-table-column label="附件类型" prop="test" min-width="180" />
                      <el-table-column label="附件名称" prop="test" min-width="180" />
                      <el-table-column label="附件说明" prop="test" min-width="180" />
                      <el-table-column label="附件来源" prop="test" min-width="180" />
                      <el-table-column label="操作" width="120" fixed="right">
                          <template #default="{ row }">
                              <el-button
                                  v-perms="['case:edit']"
                                  type="primary"
                                  link
                                  @click="handleEdit(row)"
                              >
                                  编辑
                              </el-button>
                              <el-button
                                  v-perms="['case:del']"
                                  type="danger"
                                  link
                                  @click="handleDelete(row.id)"
                              >
                                  删除
                              </el-button>
                          </template>
                      </el-table-column>
                  </el-table>
                  <el-form
                      ref="formRef"
                      label-width="194px"
                      :rules="formRules"
                      :inline="true"
                      style="padding-top: 20px"
                  >
                      <el-form-item label="已备案的证明文件备案编号：">
                          <el-input />
                      </el-form-item>
                  </el-form>
              </el-collapse-item>
          </el-collapse>

          <el-collapse v-model="activeNamesqingqiu" v-if="isokfm">
              <el-collapse-item title="发明请求书" name="1">
                  <!-- <b style="font-size: 15px">申请人费用减缴备案情况</b> -->
                  <div style="display: flex; border: 1px solid #f2f2f2">
                      <div class="namebox">
                          <span style="white-space: nowrap">是否显示英文信息</span>
                      </div>
                      <div>
                          <el-form
                              ref="formRef"
                              label-width="154px"
                              :rules="formRules"
                              :inline="true"
                              style="padding: 20px 0px 0px 60px"
                          >
                              <el-form-item>
                                  <el-checkbox-group>
                                      <el-checkbox label="" name="caseType"></el-checkbox>
                                  </el-checkbox-group>
                              </el-form-item>
                          </el-form>
                      </div>
                  </div>
                  <div style="display: flex; border: 1px solid #f2f2f2">
                      <div class="namebox">
                          <span style="white-space: nowrap">共同发明人</span>
                      </div>
                      <div>
                          <el-form
                              ref="formRef"
                              label-width="154px"
                              :rules="formRules"
                              :inline="true"
                              style="padding: 20px 0px 0px 60px"
                          >
                              <el-form-item>
                                  <el-checkbox-group>
                                      <el-checkbox
                                          label="共同发明人是否显示国籍或地区及证件号码"
                                          name="caseType"
                                      ></el-checkbox>
                                  </el-checkbox-group>
                              </el-form-item>
                          </el-form>
                      </div>
                  </div>
                  <div style="display: flex; border: 1px solid #f2f2f2">
                      <div class="namebox">
                          <span style="white-space: nowrap">申请人费用减缴备案情况</span>
                      </div>

                      <div style="padding-left: 50px">
                          <div>
                              <el-form
                                  ref="formRef"
                                  label-width="154px"
                                  :rules="formRules"
                                  :inline="true"
                                  style="padding: 20px 0px 0px 12px"
                              >
                                  <el-form-item>
                                      <el-checkbox-group>
                                          <el-checkbox
                                              label="全体申请人请求费用减缴且已完成费用减缴资格备案 "
                                              name="caseType"
                                          ></el-checkbox>
                                      </el-checkbox-group>
                                  </el-form-item>
                              </el-form>
                          </div>
                          <el-table class="mt-4" size="large">
                              <el-table-column label="序号" prop="test" min-width="180" />
                              <el-table-column label="名称" prop="test" min-width="180" />
                              <el-table-column label="总委托书编号" prop="test" min-width="180" />
                              <el-table-column label="备案证件号" prop="test" min-width="180" />
                              <el-table-column label="费减备案" prop="test" min-width="180" />
                              <el-table-column label="开始时间" prop="test" min-width="180" />
                              <el-table-column label="结束时间" prop="test" min-width="180" />
                              <el-table-column label="符合资格" prop="test" min-width="180" />
                              <el-table-column label="备注" prop="test" min-width="180" />
                          </el-table>
                      </div>
                  </div>
                  <div style="display: flex; border: 1px solid #f2f2f2">
                      <div class="namebox">
                          <span style="white-space: nowrap">代理人</span>
                      </div>
                      <div>
                          <el-form
                              ref="formRef"
                              label-width="154px"
                              :rules="formRules"
                              :inline="true"
                              style="padding-top: 20px"
                          >
                              <el-form-item label="原申请号：">
                                  <el-input />
                              </el-form-item>
                              <el-form-item label="针对的分案申请号： ">
                                  <el-input />
                              </el-form-item>
                              <el-form-item label="原申请日:">
                                  <el-input />
                              </el-form-item>
                          </el-form>
                      </div>
                  </div>
                  <div style="display: flex; border: 1px solid #f2f2f2">
                      <div class="namebox">
                          <span style="white-space: nowrap">声明</span>
                      </div>
                      <div>
                          <el-form
                              ref="formRef"
                              label-width="154px"
                              :rules="formRules"
                              :inline="true"
                              style="padding: 20px 0px 0px 60px"
                          >
                              <el-form-item>
                                  <el-checkbox-group>
                                      <el-checkbox
                                          label="声明已经与申请人签订了专利代理委托书且本表中的信息与委托书中相应信息一致"
                                          name="caseType"
                                      ></el-checkbox>
                                  </el-checkbox-group>
                              </el-form-item>
                          </el-form>
                      </div>
                  </div>
                  <div style="display: flex; border: 1px solid #f2f2f2">
                      <div class="namebox">
                          <span style="white-space: nowrap">专利代理委托书</span>
                      </div>
                      <div>
                          <el-form
                              ref="formRef"
                              label-width="154px"
                              :rules="formRules"
                              :inline="true"
                              style="padding: 20px 0px 0px 60px"
                          >
                              <el-form-item>
                                  <el-checkbox-group>
                                      <el-checkbox
                                          label="启用专利代理委托书"
                                          name="caseType"
                                      ></el-checkbox>
                                  </el-checkbox-group>
                              </el-form-item>
                          </el-form>
                      </div>
                  </div>
                  <div style="display: flex; border: 1px solid #f2f2f2">
                      <div class="namebox">
                          <span style="white-space: nowrap">分案申请</span>
                      </div>
                      <div>
                          <el-form
                              ref="formRef"
                              label-width="154px"
                              :rules="formRules"
                              :inline="true"
                              style="padding-top: 20px"
                          >
                              <el-form-item label="姓名：">
                                  <el-input />
                              </el-form-item>
                              <el-form-item label="资格证号：">
                                  <el-input />
                              </el-form-item>
                              <el-form-item label="电话：">
                                  <el-input />
                              </el-form-item>
                          </el-form>
                      </div>
                  </div>
                  <div style="display: flex; border: 1px solid #f2f2f2">
                      <div class="namebox">
                          <span style="white-space: nowrap">生物材料样品</span>
                      </div>

                      <div style="padding-left: 50px">
                          <el-table class="mt-4" size="large">
                              <el-table-column label="序号" prop="test" min-width="180" />
                              <el-table-column label="保藏单位" prop="test" min-width="180" />
                              <el-table-column label="保藏日期" prop="test" min-width="180" />
                              <el-table-column label="保藏编号" prop="test" min-width="180" />
                              <el-table-column label="分类命名" prop="test" min-width="180" />
                              <el-table-column label="是否存活" prop="test" min-width="180" />
                          </el-table>
                          <div>
                              <el-form
                                  ref="formRef"
                                  :rules="formRules"
                                  style="padding: 20px 0px 0px 8px"
                              >
                                  <el-form-item>
                                      <el-checkbox-group>
                                          <el-checkbox
                                              label="启用生物材料存活证明 "
                                              name="caseType"
                                          ></el-checkbox>
                                      </el-checkbox-group>
                                  </el-form-item>
                                  <el-form-item>
                                      <el-checkbox-group>
                                          <el-checkbox
                                              label="启用生物材料保藏证明 "
                                              name="caseType"
                                          ></el-checkbox>
                                      </el-checkbox-group>
                                  </el-form-item>
                              </el-form>
                          </div>
                      </div>
                  </div>
                  <div style="display: flex; border: 1px solid #f2f2f2">
                      <div class="namebox">
                          <span style="white-space: nowrap">序列表</span>
                      </div>
                      <div>
                          <el-form
                              ref="formRef"
                              label-width="154px"
                              :rules="formRules"
                              :inline="true"
                              style="padding: 20px 0px 0px 60px"
                          >
                              <el-form-item>
                                  <el-checkbox-group>
                                      <el-checkbox
                                          label="本专利申请涉及核苷酸或氨基酸序列表"
                                          name="caseType"
                                      ></el-checkbox>
                                  </el-checkbox-group>
                              </el-form-item>
                          </el-form>
                      </div>
                  </div>
                  <div style="display: flex; border: 1px solid #f2f2f2">
                      <div class="namebox">
                          <span style="white-space: nowrap">遗传资源</span>
                      </div>
                      <div>
                          <el-form
                              ref="formRef"
                              label-width="154px"
                              :rules="formRules"
                              :inline="true"
                              style="padding: 20px 0px 0px 60px"
                          >
                              <el-form-item>
                                  <el-checkbox-group>
                                      <el-checkbox
                                          label="本专利申请涉及的发明创造是依赖于遗传资源完成的"
                                          name="caseType"
                                      ></el-checkbox>
                                  </el-checkbox-group>
                              </el-form-item>
                          </el-form>
                      </div>
                  </div>
                  <div style="display: flex; border: 1px solid #f2f2f2">
                      <div class="namebox">
                          <span style="white-space: nowrap">不丧失新颖性宽限期申明</span>
                      </div>
                      <div>
                          <el-form
                              ref="formRef"
                              :rules="formRules"
                              style="padding: 20px 0px 0px 60px"
                          >
                              <el-form-item>
                                  <el-checkbox-group>
                                      <el-checkbox
                                          label="已在国家出现紧急状态或者非常情况时，为公共利益目的首次公开"
                                          name="caseType"
                                      ></el-checkbox>
                                  </el-checkbox-group>
                              </el-form-item>
                              <el-form-item>
                                  <el-checkbox-group>
                                      <el-checkbox
                                          label="已在中国政府主办或承认的国际展览会上首次展出"
                                          name="caseType"
                                      ></el-checkbox>
                                  </el-checkbox-group>
                              </el-form-item>
                              <el-form-item>
                                  <el-checkbox-group>
                                      <el-checkbox
                                          label="已在规定的学术会议或技术会议上首次发表"
                                          name="caseType"
                                      ></el-checkbox>
                                  </el-checkbox-group>
                              </el-form-item>
                              <el-form-item>
                                  <el-checkbox-group>
                                      <el-checkbox
                                          label="他人未经申请人同意而泄露其内容"
                                          name="caseType"
                                      ></el-checkbox>
                                  </el-checkbox-group>
                              </el-form-item>
                          </el-form>
                      </div>
                  </div>
                  <div style="display: flex; border: 1px solid #f2f2f2">
                      <div class="namebox">
                          <span style="white-space: nowrap">同日申请</span>
                      </div>
                      <div>
                          <el-form
                              ref="formRef"
                              label-width="154px"
                              :rules="formRules"
                              :inline="true"
                              style="padding: 20px 0px 0px 60px"
                          >
                              <el-form-item>
                                  <el-checkbox-group>
                                      <el-checkbox
                                          label="声明本申请人对同样的发明创造在申请本发明专利的同日申请了实用新型专利"
                                          name="caseType"
                                      ></el-checkbox>
                                  </el-checkbox-group>
                              </el-form-item>
                          </el-form>
                      </div>
                  </div>
                  <div style="display: flex; border: 1px solid #f2f2f2">
                      <div class="namebox">
                          <span style="white-space: nowrap">提前公布</span>
                      </div>
                      <div>
                          <el-form
                              ref="formRef"
                              label-width="154px"
                              :rules="formRules"
                              :inline="true"
                              style="padding: 20px 0px 0px 60px"
                          >
                              <el-form-item>
                                  <el-checkbox-group>
                                      <el-checkbox
                                          label="请求早日公布该专利申请"
                                          name="caseType"
                                      ></el-checkbox>
                                  </el-checkbox-group>
                              </el-form-item>
                          </el-form>
                      </div>
                  </div>
                  <div style="display: flex; border: 1px solid #f2f2f2">
                      <div class="namebox">
                          <span style="white-space: nowrap">实质审查请求</span>
                      </div>
                      <div>
                          <el-form
                              ref="formRef"
                              label-width="154px"
                              :rules="formRules"
                              :inline="true"
                              style="padding: 20px 0px 0px 60px"
                          >
                              <el-form-item>
                                  <el-checkbox-group>
                                      <el-checkbox
                                          label="启用实质审查请求"
                                          name="caseType"
                                      ></el-checkbox>
                                  </el-checkbox-group>
                              </el-form-item>
                          </el-form>
                      </div>
                  </div>
                  <div style="display: flex; border: 1px solid #f2f2f2">
                      <div class="namebox">
                          <span style="white-space: nowrap">向外国申请专利保密审查请求</span>
                      </div>
                      <div>
                          <el-form
                              ref="formRef"
                              label-width="154px"
                              :rules="formRules"
                              :inline="true"
                              style="padding: 20px 0px 0px 60px"
                          >
                              <el-form-item>
                                  <el-checkbox-group>
                                      <el-checkbox
                                          label="根据专利法第二十一条第一款的规定，拟就在中国完成的发明或者实用新型向外国申请专利，请求进行保密审查。"
                                          name="caseType"
                                      ></el-checkbox>
                                  </el-checkbox-group>
                              </el-form-item>
                          </el-form>
                      </div>
                  </div>
                  <div style="display: flex; border: 1px solid #f2f2f2">
                      <div class="namebox">
                          <span style="white-space: nowrap">提交共同申请格式、文件声明</span>
                      </div>
                      <div>
                          <el-form
                              ref="formRef"
                              label-width="154px"
                              :rules="formRules"
                              :inline="true"
                              style="padding: 20px 0px 0px 60px"
                          >
                              <el-form-item>
                                  <el-checkbox-group>
                                      <el-checkbox
                                          label="声明内容:根据国家知识产权局第一七六号，申请人现对本专利申请做出声明。"
                                          name="caseType"
                                      ></el-checkbox>
                                  </el-checkbox-group>
                              </el-form-item>
                          </el-form>
                      </div>
                  </div>
                  <div style="display: flex; border: 1px solid #f2f2f2">
                      <div class="namebox">
                          <span style="white-space: nowrap">附加文件</span>
                      </div>
                      <div>
                          <el-form
                              ref="formRef"
                              label-width="154px"
                              :rules="formRules"
                              :inline="true"
                              style="padding: 20px 0px 0px 60px"
                          >
                              <el-form-item>
                                  <el-checkbox-group>
                                      <el-checkbox
                                          label="启用其他证明文件"
                                          name="caseType"
                                      ></el-checkbox>
                                  </el-checkbox-group>
                              </el-form-item>
                          </el-form>
                      </div>
                  </div>
                  <div style="display: flex; border: 1px solid #f2f2f2">
                      <div class="namebox">
                          <span style="white-space: nowrap">关联业务</span>
                      </div>
                      <div>
                          <el-form
                              ref="formRef"
                              label-width="154px"
                              :rules="formRules"
                              :inline="true"
                              style="padding: 20px 0px 0px 60px"
                          >
                              <el-form-item>
                                  <el-checkbox-group>
                                      <el-checkbox
                                          label="启用优先权文件数字接入服务(DAS)请求书"
                                          name="caseType"
                                      ></el-checkbox>
                                  </el-checkbox-group>
                              </el-form-item>
                          </el-form>
                      </div>
                  </div>

                  <div style="display: flex; border: 1px solid #f2f2f2">
                      <div class="namebox">
                          <span style="white-space: nowrap">附加文件清单：</span>
                      </div>
                      <div>
                          <el-form
                              ref="formRef"
                              label-width="154px"
                              :rules="formRules"
                              :inline="true"
                              style="padding-top: 20px"
                          >
                              <el-form-item>
                                  <el-form-item label="总委托书编号：">
                                      <el-input />
                                  </el-form-item>
                                  <div style="padding: 0px 0px 20px 45px; color: #c9161b">
                                      总委托书编号以ZW开头，多个总委托书编号用逗号隔开，例如：ZW1234567890,ZW1234567891；如不填写，系统会自动带第一申请人的总委托书编号
                                  </div>
                                  <el-form-item label="证明文件备案编号： ">
                                      <el-input />
                                  </el-form-item>
                              </el-form-item>
                          </el-form>
                      </div>
                  </div>
                  <div style="display: flex; border: 1px solid #f2f2f2">
                      <div class="namebox">
                          <span style="white-space: nowrap">联系人信息：</span>
                      </div>
                      <div>
                          <div style="padding: 20px 0px 20px 45px; color: #c9161b">
                              以代理机构签名递交的，联系人可不填
                          </div>
                          <el-form
                              ref="formRef"
                              label-width="184px"
                              :rules="formRules"
                              :inline="true"
                          >
                              <el-form-item>
                                  <el-form-item label="姓名：">
                                      <el-input />
                                  </el-form-item>

                                  <el-form-item label="电话： ">
                                      <el-input />
                                  </el-form-item>
                              </el-form-item>
                              <el-form-item>
                                  <el-form-item label="邮政编码：">
                                      <el-input />
                                  </el-form-item>

                                  <el-form-item label="电子邮箱： ">
                                      <el-input />
                                  </el-form-item>
                              </el-form-item>
                              <el-form-item>
                                  <el-form-item label="省、自治区、直辖市：	">
                                      <el-input />
                                  </el-form-item>

                                  <el-form-item label="市县： ">
                                      <el-input />
                                  </el-form-item>
                              </el-form-item>
                              <el-form-item class="w-[70%]">
                                  <el-form-item label="城区(乡)、街道、门牌号：">
                                      <el-input />
                                  </el-form-item>
                              </el-form-item>
                          </el-form>
                      </div>
                  </div>
              </el-collapse-item>
          </el-collapse>
          <el-collapse v-model="activeNamesbuzheng" v-if="isokbz">
              <el-collapse-item title="补正书" name="1">
                  <br />
                  <b style="font-size: 15px">补正原因</b>
                  <el-form ref="formRef" label-width="194px" :rules="formRules" :inline="true">
                      <el-form-item>
                          <el-radio-group label="" name="caseType">
                              <el-radio label="0"
                                  >根据专利法实施细则第57条的规定，请求对上述专利申请主动提出修改。</el-radio
                              >
                          </el-radio-group>
                      </el-form-item>
                  </el-form>
                  <br />
                  <b style="font-size: 15px">补正内容</b>
                  <el-button type="primary" style="margin: 0px 0px 0px 15px">新增</el-button>
                  <el-table class="mt-4" size="large">
                      <el-table-column label="序号" prop="test" min-width="180" />
                      <el-table-column label="文件名称" prop="test" min-width="180" />
                      <el-table-column label="文件中的位置" prop="test" min-width="180" />
                      <el-table-column label="补正前" prop="test" min-width="180" />
                      <el-table-column label="补正后" prop="test" min-width="180" />
                      <el-table-column label="操作" width="120" fixed="right">
                          <template #default="{ row }">
                              <el-button
                                  v-perms="['case:edit']"
                                  type="primary"
                                  link
                                  @click="handleEdit(row)"
                              >
                                  编辑
                              </el-button>
                              <el-button
                                  v-perms="['case:del']"
                                  type="danger"
                                  link
                                  @click="handleDelete(row.id)"
                              >
                                  删除
                              </el-button>
                          </template>
                      </el-table-column>
                  </el-table>
                  <br />
                  <b style="font-size: 15px">附件清单</b>
                  <el-button type="primary" style="margin: 0px 0px 0px 15px"> 上传 </el-button>
                  <el-button type="primary" style="margin: 0px 0px 0px 15px"> 撰写 </el-button>
                  <el-table class="mt-4" size="large">
                      <el-table-column label="序号" prop="test" min-width="180" />
                      <el-table-column label="附件类型" prop="test" min-width="180" />
                      <el-table-column label="附件名称" prop="test" min-width="180" />
                      <el-table-column label="附件说明" prop="test" min-width="180" />
                      <el-table-column label="附件来源" prop="test" min-width="180" />
                      <el-table-column label="操作" width="120" fixed="right">
                          <template #default="{ row }">
                              <el-button
                                  v-perms="['case:edit']"
                                  type="primary"
                                  link
                                  @click="handleEdit(row)"
                              >
                                  编辑
                              </el-button>
                              <el-button
                                  v-perms="['case:del']"
                                  type="danger"
                                  link
                                  @click="handleDelete(row.id)"
                              >
                                  删除
                              </el-button>
                          </template>
                      </el-table-column>
                  </el-table>
                  <el-form
                      ref="formRef"
                      label-width="194px"
                      :rules="formRules"
                      :inline="true"
                      style="padding-top: 20px"
                  >
                      <el-form-item label="已备案的证明文件备案编号：">
                          <el-input />
                      </el-form-item>
                  </el-form>
              </el-collapse-item>
          </el-collapse>
      </div>
  </template>
  <script lang="ts" setup>
  import type { FormInstance } from 'element-plus'
  import { caseEdit, caseAdd, caseDetail } from '@/api/case'
  import Popup from '@/components/popup/index.vue'
  import feedback from '@/utils/feedback'
  import type { PropType } from 'vue'
  const route = useRoute()
  const router = useRouter()
  const show = ref(route.query.type)
  const isokfm = ref()
  const isoksy = ref()
  const isokbz = ref()
  if (show.value == 'submitlng') {
      //审核中展示-发明请求书、实用新型请求书
      isokfm.value = true
      isoksy.value = true
  } else if (show.value == 'pending') {
      //待处理展示-发明请求书
      isokfm.value = true
  } else if (show.value == 'draft') {
      //草稿展示-补正书
      isokbz.value = true
  } else if (show.value == 'submitDone') {
      //已完成展示-实用新型请求书
      isoksy.value = true
  }
  //v-if="show !== 'pending'"
  defineProps({
      dictData: {
          type: Object as PropType<Record<string, any[]>>,
          default: () => ({})
      }
  })
  const activeNames = ['1', '2']
  const emit = defineEmits(['success', 'close'])
  const formRef = shallowRef<FormInstance>()
  const popupRef = shallowRef<InstanceType<typeof Popup>>()
  const mode = ref('add')
  const popupTitle = computed(() => {
      return mode.value == 'edit' ? '编辑新建合同案件信息' : '新增新建合同案件信息'
  })

  const formData = reactive({
      caseName: '',
      caseType: '',
      businessType: '',
      putinType: '',
      undertakingDepartment: '',
      conductor: '',
      taxRate: '',
      costType: '',
      cost: '',
      contributionPool: '',
      ownershipDistribution: '',
      haveCase: '',
      designatedCountry: '',
      brandType: '',
      classQuantity: '',
      quantity: '',
      officialFee: '',
      agencyFee: '',
      hirdPartyPayment: '',
      signedAmount: '',
      invoiceValue: '',
      fundsReceived: '',
      paidupDate: '',
      planNumber: '',
      caseStatus: '',
      caseLink: '',
      remark: '',
      caseNameid: '',
      businessTypeid: '',
      undertakingDepartmentid: '',
      ownershipDistributionid: '',
      costTypeid: '',
      correlationTypeid: '',
      isRegister: '',
      isInvalid: '',
      isExistingcase: '',
      isPapernotice: '',
      customerDocumentNumber: '',
      copyrightType: '',
      caseFlow: '',
      countryOfOrigin: '',
      agency: '',
      proposalForm: '',
      isMaterials: '',
      isFund: '',
      initialPeriod: '',
      referenceNumber: '',
      contractNumber: '',
      budget: '',
      author: '',
      homeLocation: '',
      softwareAbbreviation: '',
      versionNumber: '',
      softwareWorkDescription: '',
      developmentCompletionDate: '',
      publishedStatus: '',
      hardwareEnvironment: '',
      softwareEnvironment: '',
      programmingLanguage: '',
      sourceQuantity: '',
      functionAndArt: '',
      handlingInformation: '',
      principalDates: '',
      customerTerm: '',
      internalWearLife: '',
      isStateCompensation: '',
      click: '',
      partOwner: '',
      todonote: '',
      manageDate: '',
      countType: '',
      numberOfPoints: '',
      addtotalstatepoint: '',
      royaltyDate: '',
      workPoints: '',
      creator: '',
      chargeType: '',
      currency: '',
      sum: '',
      advancePaymentDate: '',
      paymentRequestNumber: '',
      requestedDate: '',
      accountsDate: '',
      invoiceNumber: '',
      chargeName: '',
      chargeDepict: '',
      chargeDepictfine: '',
      extendedAmount: '',
      discountRate: '',
      count: '',
      parities: '',
      collectingCompanyAccount: '',
      collectionStatus: '',
      accountDetails: '',
      slt: '',
      externalBillingNumber: '',
      externalBillingDate: '',
      beddingCondition: '',
      handOver: '',
      expenseNote: '',
      reductionType: '',
      actualCurrency: '',
      officialDeadline: '',
      ourRef: '',
      relevantCaseName: '',
      correlationType: '',
      userId: '',
      userName: '',
      id: '',
      updateUserId: '',
      updateUserName: ''
  })

  const formRules = {
      caseName: [
          {
              required: true,
              message: '请输入案件名称',
              trigger: ['blur']
          }
      ],
      businessType: [
          {
              required: true,
              message: '请选择业务类型',
              trigger: ['blur']
          }
      ],
      undertakingDepartment: [
          {
              required: true,
              message: '请选择承办部门',
              trigger: ['blur']
          }
      ],
      designatedCountry: [
          {
              required: true,
              message: '请输入申请国家（地区）',
              trigger: ['blur']
          }
      ],
      handlingInformation: [
          {
              required: true,
              message: '请输入处理事项',
              trigger: ['blur']
          }
      ],
      id: [
          {
              required: true,
              message: '请输入主键ID',
              trigger: ['blur']
          }
      ]
  }

  const handleSubmit = async () => {
      await formRef.value?.validate()
      const data: any = { ...formData }
      mode.value == 'edit' ? await caseEdit(data) : await caseAdd(data)
      popupRef.value?.close()
      feedback.msgSuccess('操作成功')
      emit('success')
  }

  const open = (type = 'add') => {
      mode.value = type
      popupRef.value?.open()
  }

  const setFormData = async (data: Record<string, any>) => {
      for (const key in formData) {
          if (data[key] != null && data[key] != undefined) {
              //@ts-ignore
              formData[key] = data[key]
          }
      }
  }

  const getDetail = async (row: Record<string, any>) => {
      const data = await caseDetail({
          id: row.id
      })
      setFormData(data)
  }

  const handleClose = () => {
      emit('close')
  }

  defineExpose({
      open,
      setFormData,
      getDetail
  })
  </script>
  <style>
  .formEdit .el-form-item {
      width: 590px;
  }
  ::v-deep .el-collapse-item__header {
    padding-left: 54px;
    background-color: var(--el-bg-color-collapse);
    font-size: 16px;
    font-weight: 600;
    color: var(--el-text-color-collapse);
  }
  ::v-deep .el-collapse-item__wrap {
      padding-top: 20px;
  }
  .namebox {
      /* padding: 0px 50px; */
      min-width: 175px;
      background-color: var(--el-bg-color-collapse);
      display: flex;
      justify-content: center;
      align-items: center;
  }
  .cpctitle {
      padding-top: 7px;
      font-size: medium;
      font-weight: 600;
  }
  </style>
